Visual Basic (Declaration) | |
---|---|
Public Overloads Shared Function EncodeBytes( _ ByVal input() As Byte, _ ByVal start As Integer, _ ByVal length As Integer _ ) As String |
Parameters
- input
- start
- length
Library/Library.Test/TestHexEncoding.cs
C# | Copy Code |
---|---|
const string hex = "0102030405060708090a0b0c0d0e0f10"; byte[] bin = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }; Assert.AreEqual(hex.Substring(4, 10), HexEncoding.EncodeBytes(bin, 2, 5)); Assert.AreEqual(0, BinaryComparer.Compare(new byte[] { 3, 4, 5, 6 }, HexEncoding.DecodeBytes(hex, 4, 8))); |
VB.NET | Copy Code |
---|---|
Const hex As String = "0102030405060708090a0b0c0d0e0f10" Dim bin As Byte() = New Byte() {1, 2, 3, 4, 5, 6, _ 7, 8, 9, 10, 11, 12, _ 13, 14, 15, 16} Assert.AreEqual(hex.Substring(4, 10), HexEncoding.EncodeBytes(bin, 2, 5)) Assert.AreEqual(0, BinaryComparer.Compare(New Byte() {3, 4, 5, 6}, HexEncoding.DecodeBytes(hex, 4, 8))) |
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7
Reference
HexEncoding ClassHexEncoding Members
Overload List